﻿using ZilLion.Core.Unities.UnitiesMethods.WebApi.Http;
using ZilLion.Task.Domain.Taskmanager.Entity;
using ZilLion.Task.Domain.Taskmanager.Response;
using ZilLion.Task.Domain.WebEntity;

namespace ZilLion.Task.Domain.Taskmanager.Repository
{
    public class TaskCommandRespository : WebApiRepositoryBase<HttpNoCompressionClient>
    {
        public TaskCommandResponse GetUnHandleTaskConmmandEntities(string nodeid)
        {
            var url =
                $"Api/TaskCommand/UnHandleConmmand/{nodeid}";
            return HttpGet<TaskCommandResponse>(url);
        }

        public bool SaveTaskConmmandEntity(TaskConmmandEntity entity)
        {
            var url =
                $"Api/TaskCommand/SaveTaskConmmand";
            var response = HttpPost<TaskConmmandEntity, ResponseResultInfo>(entity, url);

            return (response != null) && response.IsSuccess;
        }
    }
}